package com.music.service.impl;

import com.music.common.BaseResult;
import com.music.dao.CmMusicsReqtMapper;
import com.music.entity.req.CmMusicsReqt;
import com.music.service.CmMusicsReqtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author Tong
 * @Date 2020/12/18 20:10
 */
@Service
public class CmMusicsReqtServiceImpl implements CmMusicsReqtService {
    @Autowired
    CmMusicsReqtMapper cmMusicsReqtMapper;

    @Override
    public BaseResult myhomemusicfindAll() {
        BaseResult baseResult = new BaseResult();
        List<CmMusicsReqt> cmMusicsReqts = cmMusicsReqtMapper.myhomemusicfindAll();
        ArrayList<CmMusicsReqt> objects = new ArrayList<>();
        for (int i = 0; i <10;i++){
            objects.add(cmMusicsReqts.get(i));
        }
        if(cmMusicsReqts!=null){
            baseResult.setData(objects);
            baseResult.setCode(200);
            baseResult.setMessage("查询成功");
            return baseResult;
        }
        baseResult.setCode(201);
        baseResult.setMessage("查询失败");
        return baseResult;

    }
}
